<%@ page import="java.util.*" %>
<%@ page import="com.google.appengine.api.datastore.Entity" %>
<html>
<body> 
    Data : <a href="add">Add <%=request.getAttribute("name")%></a>
    <hr />
 
    <h2>All <%=request.getAttribute("name")%></h2>
    <table border="1">
        <thead>
            <tr>
            <%
                String[] columns = (String[])request.getAttribute("columns");
                for(String column : columns){
            %>
                    <td><%=column%></td>
            <%
                }
            %>
                <td>operation</td>
            </tr>
        </thead>
        <%
 
            List datas = (List)request.getAttribute("list");
            for(Object e : datas){
 
        %>
            <tr>
            <%
                for(String column : columns){
            %>
                    <td>
                    <%=e.getClass().getMethod("get" + column.substring(0, 1).toUpperCase() + column.substring(1)).invoke(e)%>
                    </td>
            <%
                }
            %>
                <td><a href="update/<%=e.getClass().getMethod("getId").invoke(e)%>">Update</a> 
                             | <a href="delete/<%=e.getClass().getMethod("getId").invoke(e)%>">Delete</a></td>
            </tr>
        <%
            }
        %>
    </table>
 
</body>
</html>